#ifndef _BATTLE_SCENE_
#define _BATTLE_SCENE_

#include "aerial\Game\Helper\AirContactListener.h"

#include "aerial\Scene\Scene.h"
#include "Box2D\Box2D.h"

namespace air 
{
	class Text;
	class Panel;
	class Button;
}

using namespace air;

class FlyObject;
class Fighter;
class Scout;
class Vulcan;

/**
 * @brief the Scene where all the aircrafts fight each other
 */
class BattleScene: public IScene
{
public:
	BattleScene();
	~BattleScene();
	bool initialize();

	void renderMiniMap();

	bool update(float dt);
	bool render(float dt);
	/// @brief map coordination of every objects from box2d to hge
	void CoordinateTransformBH();
	void Back();
	void ExitToMainMenu();
	uchar alivePlayerCount[2];
	uchar playerCount;

	/**
	 * @brief the flying objects controlled by players.
	 */
	FlyObject* self;
	/// @brief the flying objects in the battle. max supportability number 10 player.
	FlyObject* fObjs[MAX_PLAYER_COUNT];
	
private:
	
	/// @brief Batch Update means to update all the information from server to client. It is done every 60 frames. batchUpdate is used to record the count.
	int fullUpdateCount;

	hgeInputEvent* inputEvent;
	b2World* world;
	AirContactListener airContactListener;
	Text *hint, *panelHint;
	Panel *hintBox;
	Button *exit, *back;

	static const uchar MaxPlayerCount;
	static const int MaxFullUpdate;
	hgeSprite* background;
	hgeSprite* white;
	hgeSprite* blue;
	hgeSprite* red;
	hgeSprite* minibg;
	bool toExit;
	bool serverConnect;
	bool panelDisplayed;
	bool performed;

	hgeColor gradient;
	uchar winSide;
};
#endif
